package org.example.extension.factoryBean;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

@Component
public class CustomFactoryBean implements FactoryBean<SomeComplexObject> {

    @Override
    public SomeComplexObject getObject() throws Exception {
        // create a complex object here
        System.out.println("CustomFactoryBean.getObject()");
        return new SomeComplexObject();
    }

    @Override
    public Class<?> getObjectType() {
        return SomeComplexObject.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}
